What's faster? select [object] or select new {[object].value1, [object].value2} with linq
Posted
by Darcy
on Stack Overflow
See other posts from Stack Overflow
or by Darcy
Published on 2010-03-11T20:18:19Z
Indexed on
2010/03/11
20:24 UTC
Read the original article
Hit count: 293
I was hoping some of you guru's out there know the answer to this question. Which is faster? A or B
A:
var item = from d in database
select d;
B:
var item = from d in database
select new {d.item1, d.item2};
SEEMINGLY, it seems like selecting part of the table object would be faster than selecting the entire object, but something tells me its not necessarily the case.
© Stack Overflow or respective owner